﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 通用类库.DataProvider
{
    public class StockPriceChangeEventArgs : EventArgs
    {
        public StockPriceChangeEventArgs(StockLevel2Info level2Info)
        {
            _level2Info = level2Info;
        }
        private StockLevel2Info _level2Info;

        public StockLevel2Info Level2Info
        {
            get { return _level2Info; }
            set { _level2Info = value; }
        }
    }
    [Serializable]
    public partial class StockLevel2Info : ICloneable
    { 
        public Int64 Id { get; set; }
        public string StockCode { get; set; }
        public string StockName { get; set; }
        public DateTime PriceDataTime { get; set; }
        public decimal Price { get; set; }
        public int MatchNumber { get; set; }
        public decimal MatchVolume { get; set; }
        public int MatchAmount { get; set; }
        public bool direction { get; set; }
        public decimal Buy1Price { get; set; }
        public int Buy1Amount { get; set; }
        public decimal Buy2Price { get; set; }
        public int Buy2Amount { get; set; }
        public decimal Buy3Price { get; set; }
        public int Buy3Amount { get; set; }
        public decimal Buy4Price { get; set; }
        public int Buy4Amount { get; set; }
        public decimal Buy5Price { get; set; }
        public int Buy5Amount { get; set; }
        public decimal Buy6Price { get; set; }
        public int Buy6Amount { get; set; }
        public decimal Buy7Price { get; set; }
        public int Buy7Amount { get; set; }
        public decimal Buy8Price { get; set; }
        public int Buy8Amount { get; set; }
        public decimal Buy9Price { get; set; }
        public int Buy9Amount { get; set; }
        public decimal Buy10Price { get; set; }
        public int Buy10Amount { get; set; }
        public decimal Sale1Price { get; set; }
        public int Sale1Amount { get; set; }
        public decimal Sale2Price { get; set; }
        public int Sale2Amount { get; set; }
        public decimal Sale3Price { get; set; }
        public int Sale3Amount { get; set; }
        public decimal Sale4Price { get; set; }
        public int Sale4Amount { get; set; }
        public decimal Sale5Price { get; set; }
        public int Sale5Amount { get; set; }
        public decimal Sale6Price { get; set; }
        public int Sale6Amount { get; set; }
        public decimal Sale7Price { get; set; }
        public int Sale7Amount { get; set; }
        public decimal Sale8Price { get; set; }
        public int Sale8Amount { get; set; }
        public decimal Sale9Price { get; set; }
        public int Sale9Amount { get; set; }
        public decimal Sale10Price { get; set; }
        public int Sale10Amount { get; set; }

        public decimal PreClosePrice { get; set; }
        public decimal LowPrice { get; set; }
        public decimal HighPrice { get; set; }
        public decimal OpenPrice { get; set; }
        /// <summary>
        ///  // 今日总成交金额
        /// </summary>
        public decimal TotalVolume { get; set; }
        /// <summary>
        /// // 今日总手，总成交量
        /// </summary>
        public int TotalAmount { get; set; }

        public override string ToString()
        {
            return string.Format("StockCode:{0},B1:{1},A1:{2},B2:{3},A2:{4},B3:{5},A3{6}---S1:{7},A1{8},S2:{9},A2{10},S3:{11},A3{12}，T：{13}V:{14},P:{15:F3}",
            StockCode,
            Buy1Price,
            Buy1Amount,
            Buy2Price,
            Buy2Amount,
            Buy3Price,
            Buy3Amount,
            Sale1Price,
            Sale1Amount,
            Sale2Price,
            Sale2Amount,
            Sale3Price,
            Sale3Amount,
             PriceDataTime.ToString("HH:mm:ss"),
             MatchAmount,
              Price
             );
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }



         
        public decimal TopPrice
        {
            get
            {
                return Math.Round(PreClosePrice * 1.1M, 2, MidpointRounding.AwayFromZero);
            }
        }
          
        public decimal BottomPrice
        {
            get
            {
                return Math.Round(PreClosePrice * 0.9M, 2, MidpointRounding.AwayFromZero);
            }
        }
    }
}
